# -*- coding: utf-8 -*-
"""
Created on Fri Nov  9 14:57:52 2012

@author: nico
"""

# Make sure to have the server side running in V-REP!
# Start the server from a child script with following command:
# simExtRemoteApiStart(19999) -- starts a remote API server service on port 19999

import vrep






#
#
#print 'Program started'
#if vrep.simxStart('127.0.0.1',19998,True,True,5000)!=-1:
    #print 'Connected to remote API server'
    #res,objs=vrep.simxGetObjects(vrep.sim_handle_all,vrep.simx_opmode_oneshot_wait)
    #if res==vrep.simx_error_noerror:
        #print 'Number of objects in the scene: ',len(objs)
        #error,h=vrep.simxGetObjectHandle('Zero',vrep.simx_opmode_oneshot_wait)
        #print error
        #error,pos=vrep.simxGetObjectPosition(h,-1,vrep.simx_opmode_oneshot_wait)
        #print error
        #print pos
        #vrep.simxSetObjectPosition(h,-1,[3.0, 2.0, 0.0],vrep.simx_opmode_oneshot_wait)
        #error,dist_handle=vrep.simxGetDistanceHandle('Distance',vrep.simx_opmode_oneshot_wait)
        #print error
        #error,dist=vrep.simxReadDistance(dist_handle,vrep.simx_opmode_oneshot_wait)
        #print error
        #print dist
    #else:
        #print 'Remote API function call returned with error code: ',res
    #vrep.simxFinish()
#else:
    #print 'Failed connecting to remote API server'
#print 'Program ended'
